/**
 * Created by Sky on 2016/5/16.
 */
module.exports = function($parse,$rootScope){
    return {
        restrict: 'E',
        template: '<input type="date" ng-model="reportDate"  style="height: 2rem;font-size: 0.8rem;"/>',
        replace: true,
        link: function($scope, element, attrs, controller) {
            element.bind('change', function(e) {
                var year=$scope.reportDate.getFullYear();
                var month=$scope.reportDate.getMonth()+1;
                var day=$scope.reportDate.getDate();
                $scope.reportYear=year;
                $scope.reportMonth=month;
                $scope.reportDay=day;

            });
        }
    };

};